home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 7
/
FM Towns Free Software Collection 7.iso
/
taropyon
/
guilib3
/
inc
/
disp.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-11-30
|
11KB
|
309 lines
/* :*****************************************************************
: "disp.h" : system“Pride”ディスプレイ・ライブラリ
:*****************************************************************
*/
#ifndef _DISP_H
#define _DISP_H
#ifndef _GUIDEFS_H
# include <guidefs.h>
#endif
#define COLMIX(c1,c2) (0x1000|(((c1)&15)<<4)|((c2)&15))
extern int FONTseg; /* 12ドットフォントセレクタ */
extern int ICONseg; /* 24×ドットアイコンセレクタ */
/* "dspini.c" ------------------------------------------------*/
/* 通常アプリケーション用初期化 */
extern int DSP_sysInit( DSPCTRL *dspctrl_ptr );
extern void DSP_sysEnd(void);
/* "dsprini.c" ------------------------------------------------*/
extern int DSP_sysReInit(void);
/* "dspsdk.c" ------------------------------------------------*/
/* サイドワーク・アプリケーション用初期化 */
extern int DSP_sdk_sysInit( DSPCTRL *dspctrl_ptr );
extern void DSP_sdk_sysEnd(void);
/* "dsppcl.c" ------------------------------------------------*/
/* 子プロセス・アプリケーション用初期化 */
extern int DSP_pcl_sysInit( DSPCTRL *dspctrl_ptr );
extern void DSP_pcl_sysEnd(void);
/* "dsptile.c" ------------------------------------------------*/
extern void DSP_setTilePattern( int md, COLOR c1, COLOR c2 );
/* "dspwpage.c" ------------------------------------------------*/
extern void DSP_writePage(int page);
/* "dspcnvp.c" ------------------------------------------------*/
#define _CVTPOINT(x1,y1,x2,y2) { \
int _wk; \
if ( (x1) > (x2) ) \
{ _wk = (x1); (x1) = (x2); (x2) = _wk; \
} \
if ( (y1) > (y2) ) \
{ _wk = (y1); (y1) = (y2); (y2) = _wk; \
} \
}
extern void _cvtPOINT(int *x1, int *y1, int *x2, int *y2);
/* "dsppara.c" ------------------------------------------------*/
struct DISPARA
{ SHORT col;
UCHAR fun;
};
extern struct DISPARA _dispara;
/* "dsppset.c" ------------------------------------------------*/
struct PSETPARA
{ short int n;
short int x0, y0;
};
extern struct PSETPARA _psetpara;
#define pset(_x0,_y0,_fun,_col) { \
_dispara.col = (_col); \
_dispara.fun = (_fun); \
_psetpara.x0 = (_x0); \
_psetpara.y0 = (_y0); \
_pset(); \
}
extern void _pset(void);
/* "dspline.c" ------------------------------------------------*/
struct LINEPARA
{ SHORT n;
SHORT x1, y1, x2, y2;
};
extern struct LINEPARA _linepara;
#define line(_x1,_y1,_x2,_y2,_fun,_col) { \
_dispara.col = (_col); \
_dispara.fun = (_fun); \
_linepara.x1 = (_x1); _linepara.y1 = (_y1); \
_linepara.x2 = (_x2); _linepara.y2 = (_y2); \
_line(); \
}
extern void _line(void);
/* "dspbox.c" ------------------------------------------------*/
struct BOXPARA
{ SHORT x1, y1, x2, y2;
};
extern struct BOXPARA _boxpara;
#define box(_x1,_y1,_x2,_y2,_fun,_col) { \
_dispara.col = (_col); \
_dispara.fun = (_fun); \
_boxpara.x1 = (_x1); _boxpara.y1 = (_y1); \
_boxpara.x2 = (_x2); _boxpara.y2 = (_y2); \
_box(); \
}
extern void _box(void);
/* "dspboxf.c" ------------------------------------------------*/
#define boxf(_x1,_y1,_x2,_y2,_fun,_col) { \
_dispara.col = (_col); \
_dispara.fun = (_fun); \
_boxpara.x1 = (_x1); _boxpara.y1 = (_y1); \
_boxpara.x2 = (_x2); _boxpara.y2 = (_y2); \
_boxf(); \
}
extern void _boxf(void);
/* "dsp_hv.c" ------------------------------------------------*/
extern void HVbox(int x1, int y1, int x2, int y2, COLOR col);
extern void HVboxf( int x1, int y1, int x2, int y2, COLOR col );
extern void boxCON(int x1, int y1, int x2, int y2, COLOR hil, COLOR sha );
extern void boxHOL(int x1, int y1, int x2, int y2, COLOR hil, COLOR sha );
extern void boxfHOL(int x1, int y1, int x2, int y2, COLOR col, COLOR hil, COLOR sha );
/* "vram.asm" ------------------------------------------------*/
#define PAGE0 0x00000
#define PAGE1 0x40000
#define WRTADR(x,y) ((x)/2)+((y)*512)
#define WRTPAGE(p) (p*PAGE1)
#define WRTCOL(c) _Col_cnv[c]
#define WRTSTR(s,x,y,col,bac,fnt) wrtstr(s,WRTPAGE(DspCtrl.writePage),WRTADR(x,y),WRTCOL(col),WRTCOL(bac),fnt)
#define WRTCLS(x0,y0,xs,ys,col) vram_cls(WRTPAGE(DspCtrl.writePage)+WRTADR(x0,y0),xs,ys,WRTCOL(col))
#define WRTANK(ch,x0,y0,col,bac) wrt_ank(ch,WRTPAGE(DspCtrl.writePage)+WRTADR(x0,y0),WRTCOL(col),WRTCOL(bac))
#define WRTKAN(ch,x0,y0,col,bac) wrt_kan(ch,WRTPAGE(DspCtrl.writePage)+WRTADR(x0,y0),WRTCOL(col),WRTCOL(bac))
extern void wrtstr(CONST char *str,int page,int adr,int ccol,int bcol,int font);
extern void vram_cls( int adr,int siz,int len,int cl);
extern void vram_scrool( int adr,int siz,int len,int cl);
extern void vram_bk_scr( int adr,int siz,int len,int cl);
extern void wrt_ank(int ch,int adr,int fc,int bc);
extern void wrt_kan(int ch,int adr,int fc,int bc);
/* "dspblk.c" ------------------------------------------------*/
typedef struct
{ char *ptn;
SHORT sel;
FRAME fr;
char _dmy[2];
char img[1];
} GBLK;
extern GBLK *DSP_push_vram( FRAME *fr );
extern void DSP_pop_vram( GBLK *gbuf );
extern void DSP_dsp_vram( GBLK *gbuf );
/* "dspvblk.c" ------------------------------------------------*/
typedef struct
{ char *path; /* パス名 */
int page; /* 書き込みページ */
char *ptn;
short int sel; /* セレクタ */
FRAME fr;
char _dmy[2];
char img[1];
} VGBLK;
#define VDPUSH_AUTO (0)
#define VDPUSH_MEM (1)
#define VDPUSH_DSK (2)
extern char DspSwapDir[128];
extern VGBLK *DSP_VDpushVram( int md, int x1, int y1, int x2, int y2);
extern void DSP_VDpopVram( VGBLK *para );
extern void DSP_VDdspVram( VGBLK *para, int x0, int y0 );
extern void DSP_VDfreeVram( VGBLK *para );
/* "dspvblk2.c" ------------------------------------------------*/
extern VGBLK *DSP_VDswapOut( VGBLK *para );
extern VGBLK *DSP_VDswapIn( VGBLK *para );
/* "dspsym.c" ------------------------------------------------*/
extern void DSP_symbol( int x0, int y0, int xb, int yb, int fun, COLOR col, COLOR bac, int font, int fntdir, int dspdir, int space, CONST char *form, ... );
/* "dspfnt.c" ------------------------------------------------*/
#define FNTYPE_ROM (0) /* ROM フォント */
#define FNTYPE_USR1 (1) /* system Pride 標準フォント */
#define FNTYPE_USR2 (2) /* ROM フォントバリエーション */
extern int _dsp_setFntTbl( int typ );
extern void DSP_set_defFnt( int typ );
extern int (*DSP_setFntTbl)(int);
/* "dspplt.c" ------------------------------------------------*/
typedef struct
{ UCHAR g, r, b;
} PLT_RGB;
extern void DSP_setPlt( PLT_RGB *rgb );
/* "dspplt1.c" ------------------------------------------------*/
extern PLT_RGB *DSP_pushPlt(void);
extern void DSP_popPlt( PLT_RGB *rgb );
/* "line.asm" ------------------------------------------------*/
#define HV_Y(y) ((y)+DspCtrl.writePage*512)
#define _Vline0(x,y1,y2,col) VLine_m00(x,y1,y2,col)
#define _Vline(x,y1,y2,col) VLine_m01(x,y1,y2,col)
#define _Hline(x1,x2,y,col) HLine_m01(x1,x2,y,col)
#define Vline0(x,y1,y2,col) VLine_m00(x,HV_Y(y1),HV_Y(y2),col)
#define Vline(x,y1,y2,col) VLine_m01(x,HV_Y(y1),HV_Y(y2),col)
#define Hline(x1,x2,y,col) HLine_m01(x1,x2,HV_Y(y),col)
extern void VLine_m00( int x ,int y0,int y1,int color );
extern void VLine_m01( int x ,int y0,int y1,int color ); /* マスクI/O使用 */
extern void HLine_m01( int x0,int x1,int y ,int color );
/* "dspwrt.c" ------------------------------------------------*/
extern int _Col_cnv[];
extern void DSP_str( int x, int y, int col,int bac, int fnt, CONST char *form, ... );
/* "dsptit.c" ------------------------------------------------*/
extern int DspTitYs;
extern void DSP_title( CONST char *apl, CONST char *ver, COLOR bacCol, COLOR strCol, COLOR basCol, COLOR boxCol );
/* "dspview.c" ------------------------------------------------*/
extern FRAME _viewFr;
#define DSP_view2(_x1,_y1,_x2,_y2) { \
FRAME _viewFr; \
_viewFr.x1 = (_x1); _viewFr.y1 = (_y1); \
_viewFr.x2 = (_x2); _viewFr.y2 = (_y2); \
DSP_view( &_viewFr ); \
}
extern void DSP_view( FRAME *fr );
/* "dsprvs.c" ------------------------------------------------*/
extern void *DSP_get_image( FRAME *fr );
extern void DSP_put_revers( void *_blk );
extern void DSP_put_image( void *_blk );
extern void DSP_free_image( void *blk );
/* "dsp010.c" ------------------------------------------------*/
#define DSPTN_RETKEY (1)
#define DSPTN_UP (2)
#define DSPTN_DOWN (3)
#define DSPTN_LEFT (4)
#define DSPTN_RIGHT (5)
#define DSPTN_RESIZE (6)
#define DSPTN_RESMAX (7)
#define DSPTN_RESMIN (8)
extern void DSP_putFont( int x0, int y0, int n, COLOR col, COLOR bac, int fun );
/* "dsp011.c" ------------------------------------------------*/
extern void DSP_egbStr( int x0, int y0, COLOR col, COLOR bac, int fnt, CONST char *form, ... );
/* "dsp012.c" ------------------------------------------------*/
extern void DSP_wrtstr12( CONST char *s, int x0, int y0, COLOR col, COLOR bac );
/* "dsp013.c" ------------------------------------------------*/
extern void DSP_egbWrtstr12( CONST char *s, int x0, int y0, COLOR col, COLOR bac );
/* "dsp014.c" ------------------------------------------------*/
extern void DSP_puts12( int x0, int y0, COLOR col, COLOR bac, CONST char *form, ... );
/* "dsp014b.c" ------------------------------------------------*/
extern void DSP_putf12( int x0, int y0, COLOR col, COLOR bac, CONST char *form, ... );
/* "dsp015.c" ------------------------------------------------*/
extern void DSP_egbPuts12( int x0, int y0, COLOR col, COLOR bac, CONST char *form, ... );
/* "dsp12fnt.asm" ------------------------------------------------*/
extern void wrt_ank12(char *dat,int adr,int fc,int bc);
extern void wrt_kan12(char *dat,int adr,int fc,int bc);
/* "dsp020.c" ------------------------------------------------*/
extern void DSP_putGearIcon( int x0, int y0, int n, int sw, int fun,
int col, int bac );
/* "dsp030.c" ------------------------------------------------*/
extern void boxHol(int x1, int y1, int x2, int y2, int fun, COLOR hil, COLOR sha );
/* "dsp031.c" ------------------------------------------------*/
extern void boxfHol(int x1, int y1, int x2, int y2, int fun, COLOR fil, COLOR hil, COLOR sha );
/* "dsp032.c" ------------------------------------------------*/
extern void boxCon(int x1, int y1, int x2, int y2, int fun, COLOR hil, COLOR sha, int n );
/* "dsp033.c" ------------------------------------------------*/
extern void boxfCon(int x1, int y1, int x2, int y2, int fun, COLOR fil, COLOR hil, COLOR sha, int n );
/* "dsptime.c" ------------------------------------------------*/
extern void SetDspTime( int page, int x, int y, COLOR strCol, COLOR bacCol );
extern void DspTime(void);
/* "dspvscr.c" ------------------------------------------------*/
extern void VerticalScroll( FRAME *fr, int scrY );
/* "boxmove.c" ------------------------------------------------*/
extern void BoxMoveAnime( FRAME *newFr, FRAME *oldFr, int frBox, int clk );
/* "iskan.asm" ------------------------------------------------*/
#ifndef _ISKAN_DEFINED
#define _ISKAN_DEFINED
extern int iskan(CONST char *str);
#endif
#endif